/*
 * Copyright 2013-2018 the original author or authors.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      https://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package org.example.demo3.demos.web.entity;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.extension.handlers.JacksonTypeHandler;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.example.demo3.demos.web.domain.po.UserInfo;
import org.example.demo3.demos.web.enums.UserStatus;

/**
 * @author <a href="mailto:chenxilzx1@gmail.com">theonefx</a>
 */
@Data
@NoArgsConstructor
@AllArgsConstructor
@ApiModel("创建相应结果")
@TableName(autoResultMap = true) // 自动映射，默认false
public class User {
    @TableId
    private String id;
    @ApiModelProperty(value = "属性描述-username",required = false)
    private String username;
    @ApiModelProperty(value = "属性描述-password" ,required = false)
    private Integer password;
    @ApiModelProperty(value = "属性描述-nickname",required = false)
    private String nickname;
    @ApiModelProperty( value = "属性描述-email",required = false)
    private String email;
    @ApiModelProperty(value = "属性描述-user_pic",required = false)
    private String user_pic;
    @TableField(value = "create_time")
    @ApiModelProperty( value = "属性描述-create_time",required = false)
    private String createTime;
    @TableField(value = "update_time")
    @ApiModelProperty(value = "属性描述-update_time",required = false)
    private String updateTime;
    @ApiModelProperty(value = "状态，1是开通，2是冻结",required = false)
    private UserStatus status;

    @TableField(typeHandler = JacksonTypeHandler.class) // mp属性，用于指定数据库字段与 Java 对象属性之间的类型处理器。而 typeHandler 属性则用于指定类型处理器，用于在数据库和 Java 对象之间转换特定类型的值。
    private UserInfo info;
}
